from django.db import models

# Create your models here.

class ShiBieModels(models.Model):
    """识别的历史记录信息"""
    image_name = models.CharField(verbose_name='图像名称',max_length=64, null=True)
    video_name = models.CharField(verbose_name='视频名称',max_length=64, null=True)
    time = models.DateTimeField(auto_now_add=True,verbose_name='检测时间')
    people = models.IntegerField(default=0,verbose_name='图像中总人数')
    nohelmet_people = models.IntegerField(default=0,verbose_name='未佩戴安全帽的人数')
    status_choices=((0,'正常佩戴安全帽'),(1,'未佩戴安全帽'))
    status = models.SmallIntegerField(default=0,verbose_name='检查结果状态',choices=status_choices)
    confidences=models.TextField(verbose_name='置信度列表',null=True)
    frame_details = models.TextField(null=True)
    class Meta:
        app_label = 'app1'

class ProcessingTask(models.Model):
    task_id = models.CharField(max_length=36, unique=True)
    status = models.CharField(max_length=20, default='pending')  # pending/processing/completed/failed
    progress = models.IntegerField(default=0)
    result = models.JSONField(null=True)
    created_at = models.DateTimeField(auto_now_add=True)